bugFix#65
Open
amans2003 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Overview
This PR implements Google OAuth authentication for the ProShop-v2 application, allowing users to sign up and log in using their Google accounts. It also includes critical fixes for Node.js v25 compatibility and macOS port conflicts.
bug#62
✨ New Features
🔐 Google OAuth Integration
Frontend Integration: Added @react-oauth/google and integrated the GoogleOAuthProvider.
Reusable Components: Created a GoogleLoginButton component that handles the OAuth flow and communicates with the backend.
Enhanced UI: Added the Google login option to both the Login and Registration screens.
Unified Auth: Implemented logic to automatically link Google accounts to existing accounts if the emails match.
🛠 Backend Enhancements
User Model Update: Added googleId field and made password optional for OAuth-based users.
Secure Verification: Integrated google-auth-library to securely verify Google ID tokens on the server side.
Environment Configuration: Added support for GOOGLE_CLIENT_ID in environment variables.
🐛 Bug Fixes & Compatibility
Node.js v25 Fix: Upgraded jsonwebtoken to v9.0.2 to resolve the TypeError: Cannot read properties of undefined (reading 'prototype') error caused by the removal of SlowBuffer in newer Node versions.
macOS Port Conflict: Changed the default backend port from 5000 to 5001 to prevent conflicts with the macOS AirPlay Receiver service, which frequently causes 403 Forbidden errors on port 5000.
Proxy Update: Updated the frontend development proxy to correctly route requests to the new backend port.
📝 Configuration Requirements
To enable Google OAuth, the following environment variables must be set:
Backend (.env): GOOGLE_CLIENT_ID
Frontend (frontend/.env): REACT_APP_GOOGLE_CLIENT_ID